/**
 * Auto gen via dbpojo-gen.
 */
package com.us.usws.service.ro.impl;

import java.util.Date;
import java.util.List;

import com.us.usws.dao.EpTokensDAO;
import com.us.usws.model.flat.epserver.DOEpTokens;
import com.us.usws.service.ro.EpTokensROService;

/**
 * Service RO impl class
 * @author robot
 */
public class EpTokensROServiceImpl implements EpTokensROService {

	//private static Log log = LogFactory.getFactory().getInstance(EpTokensROServiceImpl.class);

	/**
	 * DAO instance
	 */
	private EpTokensDAO dao = new EpTokensDAO();

	/**
	 * Get Count.
	 */
	@Override
	public int getTotalCount() {
		return dao.getTotalCount();
	}

	/**
	 * Get all list.
	 */
	@Override
	public List<DOEpTokens> getAllEpTokenss() {
		return dao.getAllEpTokenss();
	}

	/**
	 * Get all list by pagination.
	 */
	@Override
	public List<DOEpTokens> getEpTokenss(int start, int end) {
		return dao.getEpTokenss(start, end);
	}

	@Override
	public DOEpTokens getEpTokens(String token) {
		return dao.getEpTokens(token);
	}

	@Override
	public DOEpTokens getEpTokensByUserUidAndToken(String userUid, String token) {
		DOEpTokens ept = dao.getEpTokensByUserUidAndToken(userUid, token);
		return ept;
	}

	@Override
	public Date getHeatbeat(String token) {
		DOEpTokens ept = dao.getEpTokens(token);
		return ept == null ? null : ept.getHeartbeatAt();
	}
}